<?php
/**
 * Configuration file
 *
 * @package OWL
 * @subpackage Main
 * @since 1.0
 */

/**
 * Rewrite
 */
if (!defined("REWRITE_ENABLE")) {
    define ("REWRITE_ENABLE", 1);
}

/**
 * Debugging
 */
if (!defined("DEBUG_ENABLE")) {
    define ("DEBUG_ENABLE", 1);
}

/**
 * GMT TIME
 */
if (!defined("DEFAULT_GMT_OFFSET")) {
    define ("DEFAULT_GMT_OFFSET", 7);
}

/**
 * Unique phrase
 * This is for the purpose of security
 */
if (!defined("UNIQUE_PHRASE")) {
    define ("UNIQUE_PHRASE","Put your own unique phrase here");
}

/**********************************************************
 * Stop editing here
 *********************************************************/
/**
 * Basic directory
 */
if (!defined("DATA_DIR")) {
    define ("DATA_DIR","data");
}
if (!defined("SCHEMA_DIR")) {
    define ("SCHEMA_DIR","schema");
}
if (!defined("LIBS_DIR")) {
    define ("LIBS_DIR","libs");
}
if (!defined("CLASS_DIR")) {
    define ("CLASS_DIR","classes");
}
if (!defined("MODEL_DIR")) {
    define ("MODEL_DIR","models");
}
if (!defined("AJAX_DIR")) {
    define ("AJAX_DIR","ajax");
}
if (!defined("TEMPLATE_DIR")) {
    define ("TEMPLATE_DIR","default-templates");
}
if (!defined("STYLE_DIR")) {
    define ("STYLE_DIR","default-styles");
}
if (!defined("SCRIPT_DIR")) {
    define ("SCRIPT_DIR","default-scripts");
}
if (!defined("IMAGE_DIR")) {
    define ("IMAGE_DIR","images");
}
if (!defined("THEME_DIR")) {
    define ("THEME_DIR","themes");
}
if (!defined("UPLOAD_DIR")) {
    define ("UPLOAD_DIR","uploads");
}
if (!defined("DOCUMENT_DIR")) {
    define ("DOCUMENT_DIR","documents");
}
if (!defined("PUBLICATION_DIR")) {
    define ("PUBLICATION_DIR","publications");
}
if (!defined("PAGE_DIR")) {
    define ("PAGE_DIR","pages");
}
if (!defined("CK_UPLOAD_DIR")) {
    define ("CK_UPLOAD_DIR","ckupload");
}
if (!defined("WIDGETS_DIR")) {
    define ("WIDGETS_DIR","widgets");
}
if (!defined("LANGUAGE_DIR")) {
    define ("LANGUAGE_DIR","langs");
}
if (!defined("HELP_DIR")) {
    define ("HELP_DIR","help");
}


/**
 * Basic path
 */

if (!defined("APS_PATH")) {
    define ("APS_PATH",dirname(__FILE__)."/");
}
if (!defined("DATA_PATH")) {
    define ("DATA_PATH",APS_PATH.DATA_DIR."/");
}
if (!defined("SCHEMA_PATH")) {
    define ("SCHEMA_PATH",APS_PATH.SCHEMA_DIR."/");
}
if (!defined("LIBS_PATH")) {
    define ("LIBS_PATH",APS_PATH.LIBS_DIR."/");
}
if (!defined("CLASS_PATH")) {
    define ("CLASS_PATH",APS_PATH.CLASS_DIR."/");
}
if (!defined("MODEL_PATH")) {
    define ("MODEL_PATH",APS_PATH.MODEL_DIR."/");
}
if (!defined("AJAX_PATH")) {
    define ("AJAX_PATH",APS_PATH.AJAX_DIR."/");
}
if (!defined("TEMPLATE_PATH")) {
    define ("TEMPLATE_PATH",APS_PATH.TEMPLATE_DIR."/");
}
if (!defined("STYLE_PATH")) {
    define ("STYLE_PATH",APS_PATH.STYLE_DIR."/");
}
if (!defined("SCRIPT_PATH")) {
    define ("SCRIPT_PATH",APS_PATH.SCRIPT_DIR."/");
}
if (!defined("IMAGE_PATH")) {
    define ("IMAGE_PATH",APS_PATH.IMAGE_DIR."/");
}
if (!defined("THEME_PATH")) {
    define ("THEME_PATH",APS_PATH.THEME_DIR."/");
}
if (!defined("UPLOAD_PATH")) {
    define ("UPLOAD_PATH",APS_PATH.UPLOAD_DIR."/");
}
if (!defined("DOCUMENT_PATH")) {
    define ("DOCUMENT_PATH",APS_PATH.UPLOAD_DIR."/".DOCUMENT_DIR."/");
}
if (!defined("PUBLICATION_PATH")) {
    define ("PUBLICATION_PATH",APS_PATH.UPLOAD_DIR."/".PUBLICATION_DIR."/");
}
if (!defined("PAGE_PATH")) {
    define ("PAGE_PATH", DATA_PATH.PAGE_DIR."/");
}
if (!defined("WIDGETS_PATH")) {
    define ("WIDGETS_PATH",APS_PATH.WIDGETS_DIR."/");
}
if (!defined("LANGUAGE_PATH")) {
    define ("LANGUAGE_PATH",APS_PATH.LANGUAGE_DIR."/");
}


//Site URL
require_once CLASS_PATH."owl-link.php";
define("SITE_URL", Owl_Link::guess_site_url());

//CKEditor
if (!defined("CK_UPLOAD_PATH")) {
    define ("CK_UPLOAD_PATH",SITE_URL.UPLOAD_DIR."/".CK_UPLOAD_DIR."/");
}

/**
 * Other
 */
if (!defined("COOKIE_LIFETIME")) {
    define ("COOKIE_LIFETIME",864000); //10 days
}

if (!defined("OWL_VERSION")) {
    define ("OWL_VERSION", "1.0 RC 5");
}

/**
 * Define cookie hash
 */
if (!defined("COOKIEHASH")) {
    define ("COOKIEHASH", md5(UNIQUE_PHRASE));
}
